package com.sl.hx.shop.ui.home.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sl.hx.shop.R;
import com.sl.hx.shop.bean.HotSearch;

import java.util.List;

/**
 * @Author
 * @Description：搜索历史列表的adapter
 * @Date 2018/12/2
 */
public class HotSearchAdapter extends BaseQuickAdapter<HotSearch, BaseViewHolder> {

    public HotSearchAdapter(@Nullable List<HotSearch> data) {
        super(R.layout.item_search_history, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, HotSearch item) {
        helper.setText(R.id.tv_search_content, item.getName());
        if (item.getColor()==1){
            helper.setTextColor(R.id.tv_search_content,mContext.getResources().getColor(R.color.main_color));
        }
    }
}
